  <script type="text/javascript">
      $(function () {
          $('#showbindlink').on('show.bs.modal', function (event) {
            var button = $(event.relatedTarget);
            var recipient = button.data('whatever');
            var modal = $(this);
            //modal.find('.modal-title').text('New message to ' + recipient)
            //modal.find('.modal-body input').val("https://open.weixin.qq.com/connect/oauth2/authorize?appid={$Think.config.WX_APPID}&redirect_uri={$Think.config.WX_BACK_URL|urlencode}&response_type=code&scope=snsapi_userinfo&state="+recipient+"#wechat_redirect");
            $("input[name='order_num']").val(recipient);
          });
      });

</script>
 <div class="row">
                <div class="col-lg-12">
                    <h3 class="page-header">订阅退款管理</h3>
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <!-- <button type="button" class="btn btn-success btn-xs" onclick="editurl('__APP__/Level/add');">添加新的专家等级</button> -->
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="dataTable_wrapper">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th><center>订单号</center></th>
                                            <th><center>退款病例数</center></th>
                                            <th><center>退款金额</center></th>
                                            <th><center>订阅人</center></th>
                                            <th><center>被订阅专家</center></th>
                                            <th><center>操作</center></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <volist name="list" id="vo">
                                        <tr class="odd gradeX" id="{$vo.order_num}">
<!--                                             <td>
                                                <center>
                                                    <button type="button" class="btn btn-primary btn-xs" data-toggle="modal" data-target="#exampleModal" data-whatever="{$vo.id}">
                                                        <i class="fa fa-edit"></i>
                                                    </button>
                                                </center>
                                            </td> -->
                                            <td class="center" style="vertical-align: middle;"><center>{$vo['order_num']}</center></td>
                                            <td class="center" style="vertical-align: middle;"><center>{$vo['pubnums']}</center></td>
                                            <td class="center" style="vertical-align: middle;"><center>{$vo['returnfee']}</center></td>
                                            <td class="center" style="vertical-align: middle;"><center>{$vo['name']}</center></td>
                                            <td class="center" style="vertical-align: middle;"><center>{$vo['ename']}</center></td>
                                            <td class="center" style="vertical-align: middle;">
                                                <center>
                                                     <button type="button" class="btn btn-danger btn-xs" data-toggle="modal" data-target="#showbindlink" data-whatever="{$vo.order_num}">
                                                        <i class="fa fa-money"> 退款</i>
                                                    </button>
                                                </center>
                                            </td>
                                        </tr>
                                        </volist>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            {$page}
        </div>
        <div class="modal fade" id="showbindlink" tabindex="-1" role="dialog" aria-labelledby="showbindlinkLabel" aria-hidden="true">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="showbindlinkLabel">输入微信退款流水号（如果是纯金豆请输入订单号）</h4>
              </div>
              <div class="modal-body">
                <form>
                  <div class="form-group">
                    <label for="recipient-name" class="control-label">退款流水号:</label>
                    <input type="text" class="form-control" name ="recipient-name" id="recipient-name">
                  </div>
                </form>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-success" onclick="returnfee();">提交</button>
                <input type="hidden" name="order_num">
                <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
              </div>
            </div>
          </div>
        </div>
<script type="text/javascript">
      function returnfee(){
        var order_num = $.trim($("input[name='order_num']").val());
        var refund_id = $.trim($("input[name='refund_id']").val());
        if(!refund_id){
            alert('不能为空');
            $('#showbindlink').modal('hide');
            return;
        }else{
            $.post('__URL__/returnfee',{order_num:order_num,refund_id:refund_id},function(e){
                  if(e.status==1){
                    alert('操作成功');
                    $('#showbindlink').modal('hide');
                    $('#'+order_num).remove();
                  }
            });
        }
        
      }
</script>

</body>

</html>
